<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>条件渲染</title>
  <!-- 开发环境版本，包含了有帮助的命令行警告 -->
  <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>
<div id="demo">
    <p v-if="ook">成功了</p>
    <p v-else>失败</p>
    <p v-show="ook">表白成功</p>
    <p v-show="!ook">表白失败</p>
    <button @click="up">切换</button>
</div>
<script type="text/javascript">
  const vm = new Vue({
      el:'#demo',
      data: {
          ook: false
      },
      methods: {
          up() {
              // alert("df");
              this.ook = !this.ook;
          }
      }
          })
</script>
</body>
</html>